﻿namespace MassIntellect.Drawing.Shapes
{
	public class Block : Group
	{
		public Block()
		{
			//this.DragDrop += new DragEventHandler(Block_DragDrop);
			//this.DragEnter += new DragEventHandler(Block_DragEnter);
			//this.DragLeave += new EventHandler(Block_DragLeave);
			//this.DragOver += new DragEventHandler(Block_DragOver);
			//this.GiveFeedback += new GiveFeedbackEventHandler(Block_GiveFeedback);
			//this.MouseClick += new MouseEventHandler(Block_MouseClick);
			//this.MouseDoubleClick += new MouseEventHandler(Block_MouseDoubleClick);
			//this.MouseDown += new MouseEventHandler(Block_MouseDown);
			//this.MouseLeave += new EventHandler(Block_MouseLeave);
			//this.MouseMove += new MouseEventHandler(Block_MouseMove);
			//this.MouseUp += new MouseEventHandler(Block_MouseUp);
			//this.MouseWheel += new MouseEventHandler(Block_MouseWheel);
			//this.MouseHover += new EventHandler(Block_MouseHover);
			//this.MouseCaptureChanged += new EventHandler(Block_MouseCaptureChanged);
		}

		//void Block_MouseCaptureChanged(object sender, EventArgs e)
		//{
		//    if (captureShape != null)
		//        captureShape.OnMouseCaptureChanged();
		//}

		//void Block_MouseHover(object sender, EventArgs e)
		//{
		//    if (overShape != null)
		//        overShape.OnMouseHover();
		//}

		//void Block_MouseWheel(object sender, MouseEventArgs e)
		//{
		//    if (overShape != null)
		//        overShape.OnMouseWheel(e);
		//    else if (captureShape != null)
		//        captureShape.OnMouseWheel(e);
		//}

		//void Block_MouseUp(object sender, MouseEventArgs e)
		//{
		//    if (overShape != null)
		//        overShape.OnMouseUp(e);
		//    if (captureShape != null)
		//        captureShape = null;
		//}

		//void Block_MouseMove(object sender, MouseEventArgs e)
		//{
		//    if (captureShape != null)
		//        captureShape.OnMouseMove(e);
		//    else
		//    {
		//        var sh = ShapesWithFilter
		//                                .FirstOrDefault(s => s.Contains(e.Location));
		//        if (sh != null)
		//        {
		//            if (sh != overShape)
		//            {
		//                if (overShape != null)
		//                    overShape.OnMouseLeave();
		//                overShape = sh;
		//                overShape.OnMouseEnter();
		//            }
		//            else
		//                overShape.OnMouseMove(e);
		//        }
		//        else
		//            Block_MouseLeave(sender, e);
		//    }

		//}

		//void Block_MouseLeave(object sender, EventArgs e)
		//{
		//    if (overShape != null)
		//    {
		//        overShape.OnMouseLeave();
		//        overShape = null;
		//    }
		//}

		//void Block_MouseDown(object sender, MouseEventArgs e)
		//{
		//    if (overShape != null)
		//    {
		//        overShape.OnMouseDown(e);
		//        captureShape = overShape;
		//    }
		//}

		//void Block_MouseDoubleClick(object sender, MouseEventArgs e)
		//{
		//    if (overShape != null)
		//    {
		//        overShape.OnMouseDoubleClick(e);
		//    }
		//}

		//void Block_MouseClick(object sender, MouseEventArgs e)
		//{
		//    if (overShape != null)
		//    {
		//        overShape.OnMouseClick(e);
		//    }
		//}

		//void Block_DragOver(object sender, DragEventArgs e)
		//{
		//    var sh = ShapesWithFilter.FirstOrDefault(s => s.Contains(new Point(e.X, e.Y)));
		//    if (sh != null)
		//    {
		//        if (sh != dropShape)
		//        {
		//            Block_DragLeave(sender, e);
		//            Block_DragEnter(sender, e);
		//        }
		//        else
		//            dropShape.OnDragOver(e);
		//    }
		//    else if (dropShape != null)
		//        Block_DragLeave(sender, e);
		//}

		//Shape dropShape;

		//void Block_DragLeave(object sender, EventArgs e)
		//{
		//    dropShape = null;
		//}

		//void Block_DragEnter(object sender, DragEventArgs e)
		//{
		//    dropShape = ShapesWithFilter
		//                            .FirstOrDefault(s => s.Contains(new Point(e.X, e.Y)));
		//    if (dropShape != null)
		//        dropShape.OnDragEnter(e);
		//}

		//void Block_GiveFeedback(object sender, GiveFeedbackEventArgs e)
		//{
		//    if (dropShape != null)
		//        dropShape.OnGiveFeedback(e);
		//}

		//void Block_DragDrop(object sender, DragEventArgs e)
		//{
		//    if (dropShape != null)
		//        dropShape.OnDragDrop(e);
		//}
	}
}